package com.srcptit.trainning.b2;

import java.util.Scanner;

public class ExceptionDemo {
	
	/**
	 * Enter input from console.
	 * If input is a number print YES, else print NO
	 */
	public static void inputNumber() {
		String input;
		int number;
		String message = "Please enter input: ";
		
		Scanner sc = new Scanner(System.in);
		
		System.out.println(message);
		input = sc.nextLine();
		// convert string to integer number.
		try {
			number = Integer.parseInt(input);
			System.out.println("YES");
		} catch(Exception ex) {
			System.out.println("NO");
		}
		sc.close();
	}
	
	public static void main(String[] args) {
		inputNumber();
	}
	
}
